#ifndef HMAC_H_INCLUDED
#define HMAC_H_INCLUDED

#include <stdlib.h>     /* strtol */
#include <string>
#include <sstream>
#include <iomanip>
#include "MD5.h"
#define TAM_BLOQUE 64
#include <math.h>
//http://cseweb.ucsd.edu/~mihir/papers/rfc2104.txt
class HMAC{
    private:
    std::string resultado;

    unsigned char Const_ipad;
    unsigned char Const_opad;

    void paddingDeCeros(std::string& bytes);

    void XOR(unsigned char* bytes,unsigned char Xpad);

    //si la clave K es mayor que TAM_BLOQUE, se la hashea y se usa eso como clave
    void VerificarLongitudKey(std::string& K);

    void ConvertirHexABin(std::string& Bin);

    public:

    HMAC(const std::string& KEY,const unsigned char* MSJ,unsigned int SizeMsj);

    std::string getHmac(){return this->resultado;}

    ~HMAC(){}

};

#endif // HMAC_H_INCLUDED
